<?php
    session_start();
    function makeSession()
    {
        session_name('my site sesion');
        session_start();
        $_SESSION['user_name'] = 'admin';
        header( 'Location: /php/admin.php' );
    }
    function checkSession()
    {
        if ( !isset( $_SESSION['user_name'] ) )
        {
            header( 'Location: /php/6-strunka.php' );
        }
    }
    function checkUser()
    {
        if (( $_POST['email'] == 'admin' ) and ( $_POST['password'] == '1234' ))
        {
            makeSession();
        }
    }
    function userExit()
    {
        unset( $_SESSION['user_name'] );
        session_destroy();
    }
?>